VERSION 5.00
Begin VB.Form frmDebug 
   BackColor       =   &H00FFFFFF&
   Caption         =   "FXRS Transaction Debugger"
   ClientHeight    =   5160
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   9510
   Icon            =   "frmDebug.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   5160
   ScaleWidth      =   9510
   StartUpPosition =   1  'CenterOwner
   Begin VB.CheckBox chkAutoSend 
      BackColor       =   &H00FFFFFF&
      Caption         =   "Auto-Send"
      Height          =   195
      Left            =   5580
      TabIndex        =   9
      Top             =   1920
      Width           =   1215
   End
   Begin VB.CommandButton cmdSend 
      Appearance      =   0  'Flat
      BackColor       =   &H00C0E0FF&
      Caption         =   "&Send"
      Height          =   315
      Left            =   4140
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   8
      Top             =   1800
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton cmdClear 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "C&lear"
      Height          =   315
      Left            =   3240
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   4680
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton cmdClose 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "OK"
      Height          =   315
      Left            =   5040
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   4680
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton cmdParseOut 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "Parse &Out"
      Height          =   315
      Left            =   8160
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   1920
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton cmdParseIn 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "Parse &In"
      Height          =   315
      Left            =   8160
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   120
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.TextBox txtTransOut 
      BackColor       =   &H00FFFFFF&
      Height          =   2235
      Left            =   120
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   1
      Top             =   2280
      Width           =   9255
   End
   Begin VB.TextBox txtTransIn 
      Height          =   1155
      Left            =   120
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   0
      Top             =   480
      Width           =   9255
   End
   Begin VB.Label Label2 
      BackColor       =   &H00FFFFFF&
      Caption         =   "Output Transaction:"
      Height          =   195
      Left            =   120
      TabIndex        =   5
      Top             =   2040
      Width           =   1515
   End
   Begin VB.Label Label1 
      BackColor       =   &H00FFFFFF&
      Caption         =   "Input Transaction:"
      Height          =   195
      Left            =   120
      TabIndex        =   4
      Top             =   240
      Width           =   1395
   End
End
Attribute VB_Name = "frmDebug"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public WithEvents g_clsDebugParser As clsFXRSParser
Attribute g_clsDebugParser.VB_VarHelpID = -1
Dim m_blnParseIn As Boolean
'---------------------------------------------------------------------------------------
' Procedure : cmdClear_Click()
' DateTime  : 10/12/2005
' Purpose   : Clear button clears in and out trans fields
'---------------------------------------------------------------------------------------
'
Private Sub cmdClear_Click()
    txtTransIn = ""
    txtTransOut = ""
End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdClose_Click()
' DateTime  : 10/12/2005
' Purpose   : Close button clears and closes form.
'---------------------------------------------------------------------------------------
'
Private Sub cmdClose_Click()
    Call cmdClear_Click
    frmShip.StatusBar1.Panels(2) = ""
    Me.Hide
End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdParseIn_Click()
' DateTime  : 10/12/2005
' Purpose   : Parse In button Calls the ParseData method of clsDebugParser passing the
'             input transaction
'---------------------------------------------------------------------------------------
'
Private Sub cmdParseIn_Click()
    
    m_blnParseIn = True
    Call g_clsDebugParser.ParseData(txtTransIn)

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdParseOut_Click()
' DateTime  : 10/12/2005
' Purpose   : Parse Out button Calls the ParseData method of clsDebugParser passing the
'             output transaction
'---------------------------------------------------------------------------------------
'
Private Sub cmdParseOut_Click()
    
    m_blnParseIn = False
    Call g_clsDebugParser.ParseData(txtTransOut)

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdSend_Click()
' DateTime  : 10/12/2005
' Purpose   : Send button sends input transaction.
'---------------------------------------------------------------------------------------
'
Private Sub cmdSend_Click()
    frmShip.wscFXRS.SendData txtTransIn
    Call ProcessTransIn(txtTransIn)
End Sub
'---------------------------------------------------------------------------------------
' Procedure : ProcessTransIn()
' DateTime  : 10/12/2005
' Purpose   : Processes the input transaction. Saves it to the textbox and to file.
'---------------------------------------------------------------------------------------
'
Public Sub ProcessTransIn(ByVal strTransIn As String)
    
    'Write trans to file
    Open App.Path & "\DebugIn_" & Format(Date, "YYYYMMDD") & ".txt" For Append As #1
    Print #1, strTransIn
    Close #1
    
End Sub
'---------------------------------------------------------------------------------------
' Procedure : ProcessTransOut()
' DateTime  : 10/12/2005
' Purpose   : Processes the output transaction. Saves it to the textbox and to file.
'---------------------------------------------------------------------------------------
'
Public Sub ProcessTransOut(ByVal strTransOut As String)
    
    'Show trans in textbox
    txtTransOut = strTransOut

    'Write trans to file
    Open App.Path & "\DebugOut_" & Format(Date, "YYYYMMDD") & ".txt" For Append As #1
    Print #1, strTransOut
    Close #1

End Sub
'---------------------------------------------------------------------------------------
' Procedure : Form_Load()
' DateTime  : 10/12/2005
' Purpose   : Instantiate the parser class object
'---------------------------------------------------------------------------------------
'
Private Sub Form_Load()
    Set g_clsDebugParser = New clsFXRSParser
End Sub
'---------------------------------------------------------------------------------------
' Procedure : g_clsDebugParser_ParseComplete()
' DateTime  : 10/12/2005
' Purpose   : ParseComplete event sub shows either the input data or output data on the
'             frmParse.
'---------------------------------------------------------------------------------------
'
Private Sub g_clsDebugParser_ParseComplete()

    With frmParse
        If m_blnParseIn Then
            .cmdSave.Enabled = IIf(g_clsDebugParser.TotalFields <= 80, True, False)
            .Caption = "Input Transaction Fields and Data"
        Else
            .cmdSave.Enabled = False
            .Caption = "Output Transaction Fields and Data"
        End If
    End With
    
    g_intDebugStart = 0
    
    With frmParse
        .Show vbModeless, Me
        .lblTotFields = Str(g_clsDebugParser.TotalFields)
    End With
    
End Sub

